//创建路由器并暴露

//引入
import { createRouter,createWebHistory } from 'vue-router';
//引入要路由的组件
import MedicineList from '../components/MedicineList.vue'
import MedicineDetail from '../components/MedicineDetail.vue';
import MedicineAdd from '../components/MedicineAdd.vue';
//创建
const router = createRouter({
    history:createWebHistory(),
    routes:[
        {
            path:'/medicineList',
            component:MedicineList
        },
        {
            path:'/medicineDetail/:id',
            component:MedicineDetail
        },
        {
            path:'/medicineAdd',
            component:MedicineAdd
        },
        {
            path:'/',
            redirect:'/medicineList'
        }

    ],
    
    
    
})

export default router